
#version 330 core
out vec3 color;
smooth in vec2 uv;
uniform sampler2D blur;
uniform sampler2D scene;
uniform sampler2D scatter;
uniform float exposure;

vec3 pixel(sampler2D s) { return texture(s, uv).rgb; }

void main()
{
	color = pixel(scene);
	color += pow(pixel(blur)/1.2, vec3(1.2));	// bloom
	color += pixel(scatter);					// scatter
	float e = pow(0.5, exposure);
	color = pow(color/e, vec3(e));			// hdr
	color = clamp(color, 0, 1);
}


